<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"   %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
</head>
<body>

<div class="row">
    <div class="col-md-12">
        <form  method="post" id="inputForm" name="inputForm" class="form-horizontal" style="padding:5px 20px 0 0"  role="form">
            <div class="form-group">
                <label class="col-md-2 col-xs-2 control-label" for="integral">积分<i  class="red">*</i></label>
                <div class="col-md-4 col-xs-4"  >
                    <input  class="form-control"  type="hidden" id="id" name="id" value="${entity.id}"/>
                    <input  class="form-control"  type="hidden" id="userName" name="userName" value="${entity.userName}"/>
                    <input class="form-control"  name="integral"   id="integral"  type="text"  value="" placeholder="输入积分">
                </div>
            </div>
        </form>

    </div>
    <!--/.col-md-12-->
</div>
<!--/.row-->
<script>
    $(function () {
        var $inputForm = $('#inputForm');

        //ajax提交表单配置.
        var ajaxSubmitOption = {
            beforeSubmit: function () {
                //mask form,防止多次提交
                $inputForm.block()
            },
            success: function (resp, statusText) {
                $inputForm.unblock()
                window.refreshParentDataGrid();
                bootbox.hideAll();
                P.messager({content:resp.msg,type:resp.success==true?'success':'error'}) ;
            },
            url: P.ctx +  '/op/mem/update?',
            type: 'post',
            dataType: 'json'
        };

        //jquery validate 验证表单
        $inputForm.validate({
            submitHandler: function (form) {
                //验证成功之后使用jquery form提交表单.
                $(form).ajaxSubmit(ajaxSubmitOption);
            },
            rules: {
                integral: {
                    required: true,
                    maxlength: 50,
                    number:true
                }
            }, messages: {  //自定义提示消息.

            }
        }); //end validate


    });//Dom ready
</script>
</body>
</html>